<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理日志</title>
<link href="/css/base.css" type="text/css" rel="stylesheet" />
<link href="/css/manage.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.default.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<!--[if ie]><link href="/css/ie.css" type="text/css" rel="stylesheet"><![endif]-->

<script type="text/javascript">
</script>
</head>

<body>
	<!-- head -->
   <?php $this->load->view('head');?>
    <!-- head--end-->
    <?php $data['curstyle'] = 'blog'?>
    <!-- body -->
    <div class="w100p mt40 mb20">
    	<div class="w903 mg">
        	<div class="box_s1">
            	<div class="b_head"></div>
                <div class="content m_pd_s1">
                	<!-- manage-top -->
                	<?php $this->load->view('member/mangtop',$data)?>
                    <!-- manage-top--end-->
                    
                    <!-- manage-det-->
                   <div class="clearfix">
                    	<div class="box_s3 fl">
                        	<div class="b_head"></div>
                            <?php $data['leftstyle'] = 'mangblog'?>
                            <?php $this->load->view('member/blogleft',$data)?>
                            <div class="b_foot"></div>
                        </div>
                        
                        <!-- right-ope-->
                        <div class=" m_layout_s1">
                        	<div class="m_pd_s2">
                            	<div class="form_box ">
                                	<h3><a href="javascript:void(0);" class="def_btn_s2 fr delete" id="delete">删除</a>管理日志</h3>
                                    <div class="form_data_box daily_manage">
                                        <table class="form_list" width="100%">
                                            <thead>
                                                <tr>
                                                    <th width="20"><i class="delete_all chb_s1"></i></th><th width="145">标题</th><th width="135">用户</th><th width="215">正文</th><th class="tc" >日期</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            	<?php foreach ($blogList as $blog):?>
                                            		<tr>
	                                                    <td><i class="chb_s1 delete_item" dataid="<?php echo $blog['id']?>" datavalue="<?php echo $blog['id']?>"></i><input type="hidden" /></td>
	                                                    <td><a href="#" class="title"><?php echo $blog['title']?></a></td>
	                                                    <td><span class="user"><?php echo $blog['membername']?></span></td>
	                                                    <td><span class="comment"><?php echo $blog['content']?> </span></td>
	                                                    <td class="tc"><?php echo date('Y-m-d',$blog['createtime']);?></td>
	                                                </tr>
                                            	<?php endforeach;?>
                                                
                                                
                                                
                                            </tbody>
                                        </table>
                                    </div>
                                    
                                    
                                </div>
                                <div class="btn_fy">
                                <?php echo $this->pagination->create_links()?>
                                </div>
                            </div>
                        </div>
                        <!-- right-ope--end-->
                        
                        <div class="clear"></div>
                    </div>
                    <!-- manage-det--end-->
                    
                </div>
                <div class="b_foot"></div>
            </div>
        </div>
    </div>
    <!-- body--end-->
    
    <!-- foot-->
   <?php $this->load->view('foot')?>
    <!-- foot--end-->	
</body>
<script type="text/javascript">
	$(function(){
		$("#delete").click(function(){
			if($(".delete_chb").size() < 1){
				alert("请选择要删除的日志");
				return ;
			}
			if(confirm("你确定要删除日志吗？")){
				$(".delete_chb").each(function(){
					var obj = $(this);
					var blog_id = $(this).attr("idatavalue");
					$.post("<?php echo site_url('member/delblog')?>",{
							blogid:blog_id
						},function(data){
							var ret = $.parseJSON(data);
							if(ret.success=='true'){
								window.location.href='<?php echo site_url('member/mangblog')?>';
							}else{
								alert(ret.msg);
							}
							
						});
					
				});
			}
		});
	})
</script>
</html>
